﻿using System.Collections.Generic;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
using Orchard.Security.Permissions;

namespace OrchardHUN.QnA
{
    [OrchardFeature("OrchardHUN.QnA")]
    public class Permissions : IPermissionProvider
    {
        public static readonly Permission CreateDiscussion = new Permission { Description = "Create new QnA Discussion", Name = "Create QnA Discussion" };

        public virtual Feature Feature { get; set; }

        public IEnumerable<Permission> GetPermissions()
        {
            return new[]
            {
                CreateDiscussion
            };
        }

        public IEnumerable<PermissionStereotype> GetDefaultStereotypes()
        {
            return new[]
            {
                new PermissionStereotype
                {
                    Name = "Authenticated",
                    Permissions = new[] {CreateDiscussion}
                }
            };
        }
    }
}


